Delay Ajax request for 0.5 seconds when performing a user search on stream plugin page #1082
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1081 .
Describe your approach and how it fixes the issue.
Hi @kasparsd, could you use this PR?
The solution proposed by @lkraav seems to be in line with select2 documentation: https://select2.org/data-sources/ajax#rate-limiting-requests
Alternatively, it looks like
quietMillis
could have been a good option to use per documentation https://select2.github.io/select2/ :This didn't work for me however.
I'm wondering if this line should also be taken out since it looks it serves no purpose for now: https://github.com/xwp/stream/blob/develop/ui/js/admin.js#L72
As for the time window, 0.5 seconds seem to be the sweet spot for me.
Checklist
contributing.md
).Release Changelog
Release Checklist
master
branch.readme.txt
.stream.php
.Stable tag
inreadme.txt
.classes/class-plugin.php
.Change
[ ]
to[x]
to mark the items as done.